package cc.iotkit.system.controller;

import cc.iotkit.common.api.Request;
import cc.iotkit.common.web.core.BaseController;
import cc.iotkit.model.bas.BasAreaRecord;
import cc.iotkit.model.bas.BasMaintenanceUnit;
import cc.iotkit.system.service.IBasAreaService;
import cc.iotkit.system.service.IBasMaintenanceUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/bas/maintenance_unit")
@Api(tags = "保养周期单位")
public class BasMaintenanceUnitController extends BaseController {
    @Autowired
    private IBasMaintenanceUnitService service;

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/list")
    public List<BasMaintenanceUnit> list(@Validated @RequestBody Request<BasMaintenanceUnit> query) {
        return service.getList(query.getData());
    }
}
